package my.diplom.dao.service;

import my.diplom.dao.IRoleDAO;
import my.diplom.entity.Role;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: gb
 * Date: 14.07.2009
 * Time: 17:27:11
 * To change this template use File | Settings | File Templates.
 */
public class RoleService {

    private IRoleDAO roleDAO;

    public IRoleDAO getRoleDAO() {
        return roleDAO;
    }

    public void setRoleDAO(IRoleDAO roleDAO) {
        this.roleDAO = roleDAO;
    }

    public void create(Role role) {
        roleDAO.create(role);
    }

    public void update(Role role) {
        roleDAO.update(role);
    }

    public List<Role> getAll() {
        return roleDAO.getAll();
    }

    public Role getById(Long roleId) {
        return roleDAO.getById(roleId);
    }

    public Role getByName(String roleName) {
        return roleDAO.getByName(roleName);
    }

    public void delete(Role role) {
        roleDAO.delete(role);
    }
}
